package com.hudilao.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hudilao.dto.StockDTO;
import com.hudilao.entity.Stock;

/**
 * StockService接口，定义库存管理相关操作
 */
public interface StockService extends IService<Stock> {

    //根据菜品id获取库存
    Integer getStockByDishId(long dishId);

    void addStock(Long dishId, Integer quantity);


    void reduceStock(Long dishId, Integer quantity);


    Page<StockDTO> queryStock(int page, int pageSize, String dishName);

    void reduceStockAfterOrder(Long dishId,Integer quantity);
}


